package com.lancoo.dictionarydemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.lancoo.dictionary.DictionaryHelper;
import com.lancoo.dictionary.activity.DictionaryActicity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.btn_action).setOnClickListener(this);
        findViewById(R.id.btn_collection).setOnClickListener(this);
        findViewById(R.id.btn_able).setOnClickListener(this);
        //调用时需根据629获取基础平台配置的ip:port
        DictionaryHelper.setUp("http://192.168.129.130:10179/");
    }

    @Override
    public void onClick(View v) {
        int id=v.getId();
        Button button= (Button) v;
        DictionaryActicity.startWithContent(this,button.getText().toString());
    }
}
